package com.cdtu.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 
 * @TableName task
 */
@Data
public class TaskDTO implements Serializable {
    /**
     * 
     */
    private Long id;

    /**
     *
     */
    private String title;


    /**
     * 
     */
    private Long typeId;

    /**
     * 任务的等级，根据等级推荐同等级志愿者
     */
    private String grade;

    /**
     * 任务详细情况
     */
    private String detail;

    /**
     * 
     */ @JsonFormat(pattern = "yyyy-MM-dd")
    private Date publishTime;

    /**
     * 
     */
    private String publishUser;

    /**
     * 
     */
    private long surplusTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 参与人数
     */
    private Integer userNum;

    /**
     * 根据Id查找所有参与任务的志愿者
     */
    private String address;

    private boolean joined;

    //剩余人数
    private Integer surplus;

    private boolean fulled;

    private long joinNum;
    private String imageSrc;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TaskDTO taskDTO = (TaskDTO) o;
        return Objects.equals(id, taskDTO.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    @TableField(exist = false)

    private static final long serialVersionUID = 1L;
}